import Foundation
import XCTest

@testable import HaishinKit

final class RTMPMessageTests: XCTestCase {
    func testAWSMediaMessage() {
        let bytes: [UInt8] = [2, 0, 7, 95, 114, 101, 115, 117, 108, 116, 0, 63, 240, 0, 0, 0, 0, 0, 0, 3, 0, 6, 102, 109, 115, 86, 101, 114, 2, 0, 13, 70, 77, 83, 47, 51, 44, 53, 44, 49, 44, 53, 50, 53, 0, 12, 99, 97, 112, 97, 98, 105, 108, 105, 116, 105, 101, 115, 0, 64, 63, 0, 0, 0, 0, 0, 0, 0, 4, 109, 111, 100, 101, 0, 63, 240, 0, 0, 0, 0, 0, 0, 0, 0, 9, 3, 0, 5, 108, 101, 118, 101, 108, 2, 0, 6, 115, 116, 97, 116, 117, 115, 0, 4, 99, 111, 100, 101, 2, 0, 29, 78, 101, 116, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 46, 67, 111, 110, 110, 101, 99, 116, 46, 83, 117, 99, 99, 101, 115, 115, 0, 11, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 2, 0, 21, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 32, 115, 117, 99, 99, 101, 101, 100, 101, 100, 46, 0, 14, 111, 98, 106, 101, 99, 116, 69, 110, 99, 111, 100, 105, 110, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 100, 97, 116, 97, 3, 0, 7, 118, 101, 114, 115, 105, 111, 110, 2, 0, 9, 51, 44, 53, 44, 49, 44, 53, 50, 53, 0, 0, 9, 0, 0]
        let message: RTMPCommandMessage = RTMPCommandMessage(objectEncoding: .amf0)
        message.length = bytes.count
        message.payload = Data(bytes)
        print(message)
    }
}
